<admintpl file="header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:U('RequestRecord/lists')}">请求记录</a></li>
        <li class="active"><a href="javascript:">设备统计 Charts</a></li>
    </ul>
    <div>
        <div id="main" style="width: 100%;height:500px;"></div>
    </div>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/js/echarts/echarts.min.js"></script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    var strListJSON = '{$dataList}';
    var obj_list = eval(strListJSON);

    var strNameJSON = '{$dataName}';
    var obj_name = eval(strNameJSON);

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '设备统计',
            subtext: '移动设备请求统计',
            x: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: obj_name
        },
        series: [
            {
                name: '请求类型',
                type: 'pie',
                radius: '55%',
                center: ['50%', '60%'],
                data: obj_list,
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };


    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
</body>
</html>